# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Thomas Schneider <maxmusterm@gmail.com>

pkgname=libretro-parallel-n64
pkgver=5243
pkgrel=1
pkgdesc='Nintendo 64 core'
arch=(loong64 x86_64)
url=https://github.com/libretro/parallel-n64
license=(GPL2)
groups=(libretro)
depends=(
  libgl
  libretro-core-info
)
makedepends=(
  git
  mesa
)
_commit=a03fdcba6b2e9993f050b50112f597ce2f44fa2c
source=(libretro-parallel-n64::git+https://github.com/libretro/parallel-n64.git#commit=${_commit})
sha256sums=(SKIP)
options=(!lto)

pkgver() {
  cd libretro-parallel-n64
  git rev-list --count HEAD
}

build() {
  make -C libretro-parallel-n64 \
    WITH_DYNAREC=x86_64 \
    HAVE_PARALLEL=1 \
    HAVE_PARALLEL_RSP=1 \
    HAVE_THR_AL=1
}

package() {
  install -Dm 644 libretro-parallel-n64/parallel_n64_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
